package IO流;

import com.sun.javaws.IconUtil;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

public class readFile {
    public static void main(String[] args) throws IOException {

        readFile();
    }

    public static void readFile() throws IOException {
        File f= new File(".");
        System.out.println(f.getAbsolutePath());
       try (InputStream input = new FileInputStream(".\\study\\src\\IO流\\readme.txt")) {
            // 定义1000个字节大小的缓冲区:
            byte[] buffer = new byte[10];
            int n;
            while ((n = input.read(buffer)) != -1) { // 读取到缓冲区

                String s = new String(buffer,0,n);
                System.out.println(s);


            }
        }
    }
}